package io.spring.start.site.test;

import java.nio.file.Path;
import java.nio.file.Paths;

public class PathExample {

	public static void main(String[] args) {
		Path path = Paths.get(
				"C:\\Users\\liuwe\\AppData\\Local\\Temp\\project-17760837265227465970\\src\\test\\java\\com\\css\\towel\\TowelApplicationTests.java");
		System.out.println("Full path: " + path.toString());

		Path absolutePath = path.toAbsolutePath();
		System.out.println("Absolute path: " + absolutePath);

		Path fileName = path.getFileName();
		System.out.println("File name: " + fileName);

		Path parentPath = path.getParent();
		if (parentPath != null) {
			System.out.println("Parent path: " + parentPath);
		}

		String pathString = path.toString();
		System.out.println("Path as string: " + pathString);
	}

}
